<%@ include file="header.jsp" %>
<%@ include file="menu.jsp" %>
<%@ page import="timesheet.util.FileUtil"%>
<div id="scheduler_here" class="dhx_cal_container" style='width:88%; height:88%; padding-left:15px;'>
	<div style='color: #00829d;text-decoration: none;font-family: Arial;font-size: 14px;'> 
		<h2>User detail</h2>
		<h3>${user.name} ${user.firstname}</h3>
			<form action="/userupdate" method="post">
				Role : ${user.role}<br>
				<%if("admin".equals(role)){%>
					Change Role :  <input type="radio" name="role" value="admin" <c:if test="${role eq 'admin'}">checked</c:if>/>Admin</input>
								   <input type="radio" name="role" value="user" <c:if test="${role eq 'user'}">checked</c:if>/>User</input><br>
				<%}%>
				<br> <input type="hidden" name="id" value="${user.id}"/>
				<input id="mdp" type="button" name="mdp" value="Change password" onclick="hidemdp();">
				<input id="pass" type="text" name="password" value="${user.password}"/>
				<input id="can" type="button" name="can" value="Cancel" onclick="cancel();"><br><br>
				<input type="submit" value="Update"/>
			</form>
			<br>
			<form action="/userdelete" method="post">
				<input type="hidden" name="id" value="${user.id}"/>
				<input type="submit" value="Delete"/>
			</form>
			<br>
			<%if("admin".equals(role)){%>
				<a href="/userlist">User list</a>
			<%}%>
	</div>
	
</div>
<<script type="text/javascript">
$('#pass').hide();
$('#can').hide();
var pass = "${user.password}";
function hidemdp(){
	$('#mdp').hide();
	$('#pass').show();
	$('#can').show();
}
function cancel(){
	$('#pass').attr("value" , ""+pass+"");
	$('#mdp').show();
	$('#pass').hide();
	$('#can').hide();
}
</script>
</body>
</html>


